package com.vhall.component.dao.record;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vhall.component.entity.record.RecordEntity;
import com.vhall.component.entity.record.vo.CutListReqVO;
import com.vhall.component.entity.record.vo.CutListRspVO;
import com.vhall.component.entity.record.vo.GetRecordListReqVo;
import com.vhall.component.entity.record.vo.GetUploadListReqVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author dongsong
 */
@Mapper
@Repository
public interface RecordMapper extends BaseMapper<RecordEntity> {

    /**
     * 根据vodId查询音视频文件
     *
     * @param vodId vodId
     * @return 音视频数据
     */
    @Select("select * from record where vod_id=#{vodId} ")
    RecordEntity findByVodId(@Param("vodId") String vodId);

    /**
     * 根据recordId获取数量
     *
     * @param recordId recordId
     * @return 数量
     */
    Integer getNumByRecordId(String recordId);

    /**
     * 获取裁剪的数据
     *
     * @param reqVO 参数
     * @return 返回值
     */
    List<CutListRspVO> selectCutList(CutListReqVO reqVO);

    /**
     * 查找裁剪总数
     *
     * @param reqVO 参数
     * @return 返回值
     */
    Integer selectCutListCount(CutListReqVO reqVO);

    IPage<RecordEntity> selectPageList(@Param("page") Page page, @Param("reqVo") GetRecordListReqVo reqVo);

    Page<RecordEntity> selectPageInfo(@Param("page") Page<RecordEntity> page, @Param("vo") GetUploadListReqVo vo, @Param("accountIds") List<Integer> accountIds);

}
